﻿
@{
    ViewBag.Title = "HiddenTroublePageList";
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
}

@section css {
    <link href="~/Assets/css/lib/bootstrap-select.css" rel="stylesheet" />
    <link href="~/Assets/css/jquery.step.css" rel="stylesheet" />
    <style>
        th {
            text-align: center;
            font-weight: bold;
        }

        td {
            text-align: center;
            vertical-align: middle;
        }

        #step {
            margin-bottom: 60px;
        }
    </style>
}
<div class="page-content" ng-cloak ng-controller="HiddenTroubleController" ng-init="SearchModel={};page='@(Request.QueryString["page"].IsEmpty() ? "1" : Request.QueryString["page"])';
     SearchModel.SourceId ='@ViewBag.SourceId';
     GetFactoryArea();
     PageName = '@Request.CurrentExecutionFilePath.Substring(Request.CurrentExecutionFilePath.LastIndexOf("/") + 1)';
     SearchModel.State ='@(Request.QueryString["state"].IsEmpty() ? "" : Request.QueryString["state"])';
     BindDepartmentList('Dep_Select');
     GetSourceList();
     GetHiddenTroubleLevelList();
     GetFactoryArea();
     GetHiddenTroubleType();
     GetHiddenTroubleState(true);
     GetHiddenTroubleUnCompleteList(SearchModel,page);
     ">
    <div class="page-heading">
        <h1>问题整改</h1>
        <div class="options">
            <div class="btn-toolbar">

            </div>
        </div>
    </div>
    <ol class="breadcrumb">
        <li><a>主页</a></li>
        <li><a>问题管理</a></li>
        <li class="active"><a>问题整改</a></li>
    </ol>

    <div class="container-fluid">
        <div class="row">
            <form class="form-horizontal row-border">
                <div class="col-md-12">
                    <div class="panel panel-default">
                        <div class="panel-heading"><h2>过滤</h2></div>
                        <div class="panel-body">
                            <div class="form-group">
                                <label class="col-sm-1 control-label">来源：</label>
                                <div class="col-sm-2" id="div_typeselect">
                                    <select id="Source_Select" ng-model="SearchModel.SourceId" ng-change="GetHiddenTroubleUnCompleteList(SearchModel,1);" class="form-control">
                                        <option value="">所有来源</option>
                                        <option ng-repeat="x in SourceList" value="{{x.Id}}">{{x.Source}}</option>
                                    </select>
                                </div>
                                <label class="col-sm-1 control-label">园区：</label>
                                <div class="col-sm-2">
                                    <select ng-model="SearchModel.FactoryAreaId" ng-change="GetHiddenTroubleUnCompleteList(SearchModel,1);" class="form-control">
                                        <option value="">所有园区</option>
                                        <option ng-repeat="x in FactoryArea" value="{{x.Id}}">{{x.ParkName}}</option>
                                    </select>
                                </div>
                                <label class="col-sm-1 control-label">责任部门：</label>
                                <div class="col-sm-2">
                                    <select id="Dep_Select" class="selectpicker show-tick form-control" ng-model="SearchModel.DepartmentId" ng-change="GetHiddenTroubleUnCompleteList(SearchModel,1);" data-live-search="true">
                                        <option value="" selected>所有部门</option>
                                    </select>
                                </div>
                                <label class="col-sm-1 control-label">问题等级：</label>
                                <div class="col-sm-2">
                                    <select ng-model="SearchModel.LevelId" class="form-control" ng-change="GetHiddenTroubleUnCompleteList(SearchModel,1);">
                                        <option value="">所有问题等级</option>
                                        <option ng-repeat="x in LevelList" value="{{x.Id}}" title="{{x.Description}}">{{x.LevelName}}</option>
                                    </select>
                                </div>

                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">问题分类：</label>
                                <div class="col-sm-2" id="div_typeselect">
                                    <select ng-model="SearchModel.TypeId" ng-change="GetHiddenTroubleUnCompleteList(SearchModel,1);" class="form-control">
                                        <option value="">所有分类</option>
                                        <option ng-repeat="x in CategoryList" value="{{x.Id}}">{{x.TypeName}}</option>
                                    </select>
                                </div>
                                <label class="col-sm-1 control-label">状态：</label>
                                <div class="col-sm-2">
                                    <select class="form-control" ng-model="SearchModel.State" ng-change="GetHiddenTroubleUnCompleteList(SearchModel,1);">
                                        <option value="" ng-selected="true">所有状态</option>
                                        <option ng-repeat="x in StateList" value="{{x.Id}}" ng-show="!x.IsComplete">{{x.StateName}}</option>
                                    </select>
                                </div>

                                <label class="col-sm-1 control-label">单号/内容：</label>
                                <div class="col-sm-2">
                                    <input type="text" ng-model="SearchModel.Content" class="form-control" ng-change="GetHiddenTroubleUnCompleteList(SearchModel,1);" placeholder="单号/问题内容" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div id="step"></div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="panel panel-sky">
                    <div class="panel-heading">
                        <h2>问题整改清单 总数：<b ng-bind="TotalCount"></b></h2>
                        <div class="panel-ctrls">
                            <div class="btn-group">
                                <a href="HiddenTroubleAdd" class="btn btn-xs btn-inverse"><i class="fa fa-plus"></i>问题登记</a>
                            </div>
                        </div>
                    </div>
                    <div class="panel-body">
                       
                        <div class="text-center" ng-show="PageLoading">
                            <img src="~/Assets/img/loading.gif" />
                        </div>
                        <table class="table table-striped table-bordered table-hover" ng-show="!PageLoading">
                            <thead>
                                <tr style="background-color:blueviolet;">
                                    <th style="width:2%">序号</th>
                                    <th style="width:2%">单号</th>
                                    <th style="width:2%">园区</th>
                                    <th style="width:5%">来源</th>
                                    <th style="width:5%">问题内容</th>
                                    <th style="width:5%">问题等级</th>
                                    <th style="width:8%">责任部门</th>
                                    <th style="width:3%">责任人</th>
                                    <th style="width:5%">地点/部位</th>
                                    <th style="width:5%">检查时间</th>
                                    <th style="width:5%">状态</th>
                                    <th style="width:5%">响应到期时间</th>
                                    <th style="width:5%">登记人</th>
                                    <th style="width:12%">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr ng-show="HiddenTroubleList.length==0 && !PageLoading">
                                    <td colspan="14" style="text-align:center;vertical-align:middle;line-height:30px;">没有数据</td>
                                </tr>
                                <tr id="tr_{{x.FormId}}" ng-repeat="x in HiddenTroubleList" ng-show="HiddenTroubleList.length>0" ng-click="ShowSolution(x.FormId,x.SolutionList,page,PageName,'@ViewBag.SolutionAdd','@ViewBag.SolutionEdit','@ViewBag.SolutionDelete',x);ShowStep(x.SourceId,x.State);">
                                    <td ng-bind="$index+1"></td>
                                    <td ng-bind="x.FormNo"></td>
                                    <td ng-bind="x.FactoryAreaName"></td>
                                    <td ng-bind="x.SourceName"></td>
                                    <td title="{{x.Description}}">{{x.Description|HideLongText}}</td>
                                    <td ng-bind="x.LevelName"></td>
                                    <td ng-bind="x.DepartmentName"></td>
                                    <td ng-bind="x.EmployeeName"></td>
                                    <td>{{x.PlaceName}}{{x.Location}}</td>
                                    <td>{{x.CheckTime|JSONDate:'yyyy-MM-dd'}}</td>
                                    <td ng-bind="x.StateName"></td>
                                    <td>
                                        <span ng-show="x.TimeProcess>=80" class="label label-danger">{{x.InValidTime}}</span>
                                        <span ng-show="x.TimeProcess>30 && x.TimeProcess<80" class="label label-warning">{{x.InValidTime}}</span>
                                        <span ng-show="x.TimeProcess<30" class="label label-success">{{x.InValidTime}}</span>
                                    </td>
                                    <td ng-bind="x.CreateUserName"></td>
                                    <td>
                                        <a href="HiddenTroubleDetail?FormId={{x.FormId}}&page={{page}}&name={{PageName}}" ng-click="$event.stopPropagation();" class="btn btn-success btn-xs btn-label"><i class="fa fa-search"></i>查看</a>
                                        <a href="HiddenTroubleSolutionAdd?FormId={{x.FormId}}&page={{page}}&pagename={{PageName}}" ng-click="$event.stopPropagation();" ng-if="User.DepartmentId==x.DepartmentId" class="btn btn-primary btn-xs btn-label"><i class="fa fa-plus"></i>添加措施</a>
                                        <a ng-if="x.State==4&&(@ViewBag.IsManager==1)" href="HiddenTroubleReview?FormId={{x.FormId}}&page={{page}}" ng-click="$event.stopPropagation();" class="btn btn-primary btn-xs btn-label"><i class="fa fa-search-plus"></i>复查</a>
                                        @*<a ng-show="@ViewBag.HiddenTroubleFormEdit==1  || (@ViewBag.IsManageDep==0&&x.SourceId==1)" href="HiddenTroubleEdit?FormId={{x.FormId}}&page={{page}}&pagename={{PageName}}" ng-click="$event.stopPropagation();" class="btn btn-default btn-xs btn-label"><i class="fa fa-pencil"></i>编辑</a>
            <a ng-show="@ViewBag.HiddenTroubleFormDelete==1  || (@ViewBag.IsManageDep==0&&x.SourceId==1)" ng-click="DeleteHiddenTrouble(x.FormId,SearchModel,page);$event.stopPropagation();" class="btn btn-danger btn-xs btn-label"><i class="fa fa-trash-o"></i>删除</a>*@
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="text-center" ng-show="HiddenTroubleList!=null && HiddenTroubleList.length>0">
                    <ul class="pagination  justify-content-center">
                        <li class="page-item"><a class="page-link" style="cursor:pointer;" ng-click="GetHiddenTroublePageList(SearchModel,1);">首页</a></li>
                        <li class="page-item" ng-class="{'active':result.currentPage==page}" ng-repeat="page in result.pages"><a style="cursor:pointer;" ng-click="GetHiddenTroublePageList(SearchModel,page)" class="page-link" ng-bind="page"></a></li>
                        <li class="page-item"><a class="page-link" style="cursor:pointer;" ng-click="GetHiddenTroublePageList(SearchModel,(result.currentPage + 1 > result.totalPage ? result.totalPage : result.currentPage + 1))">下一页</a></li>
                        <li class="page-item"><a class="page-link" style="cursor:pointer;" ng-click="GetHiddenTroublePageList(SearchModel,result.totalPage);">尾页</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>

@section Js{
    <script src="~/Assets/js/pg/HiddenTrouble.js?v=@DateTime.Now.ToString("yyMMddHHmm")"></script>
    <script src="~/Assets/js/libs/moment.min.js"></script>
    <script src="~/Assets/js/libs/locales/date/zh-cn.js"></script>
    <script src="~/Assets/js/libs/bootstrap-datetimepicker.min.js"></script>
    <script src="~/Assets/js/libs/angularjs-datepicker.js"></script>
    <script src="~/Assets/js/libs/jquery.step.min.js"></script>
    <script>

    </script>
}

